saveToString

abstract suspend fun saveToString(scene: DesignBlock, allowedResourceSchemes: List<String> = listOf("blob", "bundle", "file", "http", "https")): String

Serializes the current scene into a string. Selection is discarded. If a resource uri has a scheme that is not in allowedResourceSchemes, an exception will be thrown.

Return

a serialized scene string.

Parameters

scene

the scene to serialize.

allowedResourceSchemes

the list of allowed resource schemes in the scene.


abstract suspend fun saveToString(scene: DesignBlock, options: SaveToStringOptions): String

Serializes the current scene into a string with optional compression. Selection is discarded. If a resource uri has a scheme that is not in options.allowedResourceSchemes, an exception will be thrown.

Return

a serialized scene string.

Parameters

scene

the scene to serialize.

options

save options containing:

  • allowedResourceSchemes: The list of allowed resource schemes in the scene. Defaults to "blob", "bundle", "file", "http", "https".

  • compression: Optional compression settings containing:

    • format: Compression format (NONE or ZSTD). Defaults to NONE.

    • level: Compression level (FASTEST, DEFAULT, or BEST). Defaults to DEFAULT.